# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=imapsync
pkgver=2.229
pkgrel=0
pkgdesc="IMAP synchronisation, sync, copy or migration tool"
url="https://imapsync.lamiral.info/"
arch="noarch"
license="NLPL"
depends="perl
	perl-app-cpanminus
	perl-ntlm
	perl-cgi
	perl-crypt-openssl-rsa
	perl-data-uniqid
	perl-digest-hmac
	perl-digest-md5
	perl-dist-checkconflicts
	perl-encode-imaputf7
	perl-file-copy-recursive
	perl-file-tail
	perl-io-socket-inet6
	perl-io-socket-ssl
	perl-io-tee
	perl-json-webtoken
	perl-libwww
	perl-mail-imapclient
	perl-module-implementation
	perl-package-stash
	perl-package-stash-xs
	perl-parse-recdescent
	perl-proc-processtable
	perl-readonly
	perl-regexp-common
	perl-sys-meminfo
	perl-term-readkey
	perl-unicode-string
	perl-uri
	procps
	"
checkdepends="
	perl-test-nowarnings
	perl-test-simple
	perl-test-warn
	"
makedepends="
	perl-module-scandeps
	perl-par-packer
	perl-test-deep
	perl-test-fatal
	perl-test-mock-guard
	perl-test-mockobject
	perl-test-pod
	perl-test-requires
	"
subpackages="$pkgname-doc"
source="https://github.com/imapsync/imapsync/archive/imapsync-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgname-$pkgver"

# NOTE: tests.sh requires authors remote imap password
check() {
	./imapsync --version
	make testp  # check dependencies
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 FAQ.d/* "$pkgdir"/usr/share/doc/$pkgname/
}

sha512sums="
1bf55f2d8b2cdae7ddf593acdf8b614404ea3aac0beb02552d6b0f7c7c3e1422b23f0bfec44536194affa4929fda340bb1e2c57f4081fc6f29417c5289666158  imapsync-2.229.tar.gz
"
